<template>
  <div>
    <div class="analysis-main">
      <div style="width: 100%;height: 70px">
        <div style="width: 95px;height: 100%">
          <img src="http://localhost:9000/static/logo.png" style="width: 100%;height: 100%;"/>
        </div>
      </div>
      <div class="menu">
        <el-menu
            default-active="2"
            class="el-menu-vertical-demo"
            :collapse="true"
        >
          <el-sub-menu index="1">
            <template #title>
              <el-icon>
                <location/>
              </el-icon>
              <span>Navigator One</span>
            </template>
            <el-menu-item-group>
              <template #title><span>Group One</span></template>
              <el-menu-item index="1-1">item one</el-menu-item>
              <el-menu-item index="1-2">item two</el-menu-item>
            </el-menu-item-group>
            <el-menu-item-group title="Group Two">
              <el-menu-item index="1-3">item three</el-menu-item>
            </el-menu-item-group>
            <el-sub-menu index="1-4">
              <template #title><span>item four</span></template>
              <el-menu-item index="1-4-1">item one</el-menu-item>
            </el-sub-menu>
          </el-sub-menu>
          <el-menu-item index="2">
            <el-icon>
              <menu/>
            </el-icon>
            <template #title>Navigator Two</template>
          </el-menu-item>
          <el-menu-item index="3" disabled>
            <el-icon>
              <document/>
            </el-icon>
            <template #title>Navigator Three</template>
          </el-menu-item>
          <el-menu-item index="4">
            <el-icon>
              <setting/>
            </el-icon>
            <template #title>Navigator Four</template>
          </el-menu-item>
        </el-menu>
      </div>
      <div class="analysis">
        <Analysis></Analysis>
      </div>
    </div>
    <div class="console-main">
      <div class="view-select">
        <el-radio-group v-model="tabPosition" style="margin-bottom: 30px" @change="changeRadio">
          <el-radio-button label="3D">3D</el-radio-button>
          <el-radio-button label="2D">2D</el-radio-button>
          <el-radio-button label="modify">modify</el-radio-button>
        </el-radio-group>
      </div>
      <div class="view">
<!--        <div style="width: 100%;height: 100%;" id="threeD">-->
<!--          <threeD v-if="showThreeD"></threeD>-->
<!--        </div>-->
<!--        <div style="width: 100%;height: 100%" id="twoD">-->
<!--          <twoD></twoD>-->
<!--        </div>-->
<!--        <div style="width: 100%;height: 100%;display:none" id="labelV">-->
<!--          <labelV></labelV>-->
<!--        </div>-->
        <div style=" width: 100%;height: 100%" id="modify">
          <tools></tools>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import {onMounted, ref} from "vue";
import {
  Document,
  Location,
  Setting, Menu,
} from '@element-plus/icons-vue'
import Analysis from "@/components/analysis/Label";
import threeD from "@/components/ThreeDViews";
import tools from "@/components/ToolsViews";
import twoD from "@/components/ThreeViews";
import labelV from "@/components/LabelViews"

export default {
  name: 'Staging',
  components: {
    Document,
    Menu,
    Location,
    Setting,
    Analysis,
    threeD,
    tools,
    twoD,
    labelV
  },
  setup() {
    const tabPosition = ref('modify')
    const showThreeD = ref(true)
    const showTools = ref(true)

    // 展示图像控制器
    function changeRadio() {
      console.log(tabPosition.value)
      // document.getElementById("myBlock");
      switch (tabPosition.value) {
        case '3D': {
          showThreeD.value = true
          // document.getElementById("twoD").style.display = 'none'
          showTools.value = false
          // document.getElementById("labelV").style.display = 'none'
          document.getElementById("modify").style.display = 'none'
          document.getElementById("threeD").style.display = 'block'
        }
          break;
        // case '2D': {
        //   document.getElementById("twoD").style.display = 'block'
        //   document.getElementById("threeD").style.display = 'none'
        //   document.getElementById("modify").style.display = 'none'
        //   document.getElementById("labelV").style.display = 'none'
        // }
          break;
        case 'modify': {
          showThreeD.value = false
          // document.getElementById("twoD").style.display = 'none'
          document.getElementById("threeD").style.display = 'none'
          showTools.value = true
          document.getElementById("modify").style.display = 'block'

          // document.getElementById("labelV").style.display = 'none'
        }
          break;
        // case 'labelV': {
        //   document.getElementById("twoD").style.display = 'none'
        //   document.getElementById("threeD").style.display = 'none'
        //   document.getElementById("modify").style.display = 'none'
        //   document.getElementById("labelV").style.display = 'block'
        // }
        //   break;
      }
    }

    return {
      tabPosition,
      changeRadio,
      showTools,
      showThreeD
    };
  },
};
</script>

<style scoped>
.analysis-main {
  height: 100vh;
  width: 383px;
  float: left;
  background-color: white;
}

.console-main {
  height: 100vh;
  width: 1520px;
  float: left;
}

.view {
  width: 95%;
  height: 90%;
  background-color: rosybrown;
  margin: auto;
  border-radius: 0 10px 10px 10px;
  box-shadow: 0 10px 10px 5px rgba(0, 0, 0, .3);
}

.view-select {
  width: 95%;
  height: 30px;
  margin: 30px auto auto;
}

.analysis-main .menu {
  width: 63px;
  height: 90vh;
  background-color: white;
  float: left;
  border-right: 1px solid #dcdfe6;
}

.analysis-main .analysis {
  width: 318px;
  height: 90vh;
  background-color: #99a9bf;
  float: left;
}
</style>
